home *** CD-ROM | disk | FTP | other *** search
/ SGI Varsity Update 1998 August / SGI Varsity Update 1998 August.iso / dist / patchSG0002777.idb / var / sysgen / Makefile.kernio.z / Makefile.kernio
Makefile  |  1998-07-29  |  5KB  |  124 lines

  1. #!smake
  2. #
  3. # Copyright 1993, 1994, Silicon Graphics Inc., Mountain View, CA. 
  4. #
  5. # Makefile.kernio
  6. #
  7. # This is a sample makefile to be used by device driver developers
  8. # doing development for Irix 6.x. A number of flags must be defined
  9. # correctly when compiling device drivers for Irix. The cflags specified
  10. # in this file are flags used by Silicon Graphics to compile drivers
  11. # for different product types. This makefile is intended as an example.
  12. #
  13. # To use this makefile, do the following:
  14. #
  15. #     1. Set the CPUBOARD environment variable to the appropriate machine 
  16. #       type (ie. IP20, IP19, IP22, etc.), for example:
  17. #
  18. #        setenv CPUBOARD IP22 
  19. #
  20. #       If you do not know what machine type you have, use the "hinv"
  21. #       or "uname -m" commands to find out.
  22. #
  23. #    2. Build the driver using this makefile:
  24. #
  25. #        make -f Makefile.kernio driver.o
  26. #
  27. # The flags used in this makefile have the following meanings:
  28. #
  29. #    _K32U64        kernel in 32 bit mode saving all 64 bits of registers
  30. #    _K64U64        kernel in 64 bit mode
  31. #    -D_KERNEL    compiled for kernel as opposed to stand alone
  32. #    -DSTATIC=static    redefine occurances for STATIC as static
  33. #    -DJUMP_WAR    workaround for R4000 branch on end of page bug
  34. #    -DPROBE_WAR    workaround for R4000 bug which requires TLBprobe be
  35. #                performed uncached
  36. #    -DBADVA_WAR    workaround for R4000 badvaddr bug
  37. #    -DTFP           R8000 (TFP) machine
  38. #    -DR4000         R4000 machine
  39. #    -DTFP        R8000 machine
  40. #    -DR10000    R10000 machine
  41. #    -G 8        global pointer set to 8
  42. #    -non_shared    do not used shared objects
  43. #    -Wc,-pic0    do not allocate extra stack space (4 words) which is 
  44. #                not necessary for coff, non_shared code
  45. #    -fullwarn    perform additional type checking
  46. #
  47. # NOTE: These options are for statically linked drivers.  See mload(4) for
  48. #       options for loadable drivers.
  49. #
  50. # In general, these flags should match those in /var/sysgen/system/irix.sm's
  51. # CCOPTS variable for any given machine type.  In case of conflict or doubt,
  52. # use the CCOPTS values from that file.
  53. #
  54.  
  55. ROOT=/
  56. include $(ROOT)/usr/include/make/commondefs
  57.  
  58. #if defined(CPUBOARD) && !empty(CPUBOARD)
  59.  
  60. #if $(CPUBOARD) == "IP17"
  61. CFLAGS=-D_K32U64 -D_KERNEL -DSTATIC=static -D_PAGESZ=4096 -DJUMP_WAR -DPROBE_WAR \
  62. -DBADVA_WAR -DIP17 -DR4000 -G 8 -non_shared -Wc,-pic0
  63. #endif
  64.  
  65. #if $(CPUBOARD) == "IP19"
  66. #if $(COMPILATION_MODEL) == "64"
  67. CFLAGS=-D_K64U64 -D_KERNEL -DSTATIC=static -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE \
  68. -DEVEREST -DIP19 -DMP -DR4000 -G 8 -non_shared -xansi -64 -mips3 \
  69. -TENV:kernel -TENV:misalignment=1 -OPT:space
  70. #else
  71. CFLAGS=-D_K32U64 -D_KERNEL -DSTATIC=static -DEVEREST \
  72. -DBADVA_WAR -DIP19 -DR4000 -G 8 -non_shared -Wc,-pic0
  73. #endif
  74. #endif
  75.  
  76. #if $(CPUBOARD) == "IP20"
  77. CFLAGS=-D_K32U64 -D_KERNEL -DSTATIC=static -D_PAGESZ=4096 -DJUMP_WAR -DPROBE_WAR \
  78. -DBADVA_WAR -DIP20 -DR4000 -G 8 -non_shared -Wc,-pic0
  79. #endif
  80.  
  81. #if $(CPUBOARD) == "IP21"
  82. CFLAGS=-D_K64U64 -D_KERNEL -DSTATIC=static -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE \
  83. -DEVEREST -DIP21 -DMP -DTFP -G 8 -non_shared -xansi -64 -mips4 \
  84. -TENV:kernel -TENV:misalignment=1 -OPT:space
  85. #endif
  86.  
  87. #if $(CPUBOARD) == "IP22"
  88. CFLAGS=-D_K32U64 -D_KERNEL -DSTATIC=static -D_PAGESZ=4096 -DJUMP_WAR \
  89. DPROBE_WAR -DBADVA_WAR -DIP22 -DR4000 -G 8 -non_shared -Wc,-pic0
  90. #endif
  91.  
  92. #if $(CPUBOARD) == "IP25"
  93. CFLAGS=-D_K64U64 -D_KERNEL -DSTATIC=static -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE \
  94. -DEVEREST -DIP25 -DMP -DR10000 -G 8 -non_shared -xansi -64 -mips4 \
  95. -TENV:kernel -TENV:misalignment=1 -OPT:space
  96. #endif
  97.  
  98. #if $(CPUBOARD) == "IP26"
  99. CFLAGS=-D_K64U64 -D_KERNEL -DSTATIC=static -D_PAGESZ=16384 -D_MIPS3_ADDRSPACE \
  100. -D_NO_UNCACHED_MEM_WAR -DIP26 -DTFP -G 8 -non_shared -xansi -fullwarn -64 \
  101. -mips4 -TENV:kernel -TENV:misalignment=1 -OPT:space -OPT:unroll_times=0 \
  102. -OPT:quad_align_branch_targets=FALSE -OPT:quad_align_with_memops=FALSE
  103. #endif
  104.  
  105. #if $(CPUBOARD) == "IP28"
  106. # All Indigo2 10000 kernel modules must be built with the t5_no_spec_stores
  107. # option to the C compiler and assembler.  This is availiable in the MIPSpro
  108. # 7.0 (or later release with the default compilers).  With a base 6.2
  109. # development suite, some compiler portions from the compiler_eoe subsystem
  110. # must be used.  These compilers will only exist on Indigo2 10000 sytems
  111. # by default.
  112. T5_SPEC_STORES_62=-Yb,/var/sysgen//root/usr/lib64/cmplrs \
  113.           -Wb,-TARG:t5_no_spec_stores
  114. T5_SPEC_STORES_70=-v6 -TARG:t5_no_spec_stores
  115. CFLAGS=-D_PAGESZ=16384 -D_KERNEL -DSTATIC=static -D_MIPS3_ADDRSPACE \
  116. -DSCACHE_SET_ASSOC=2 -D_NO_UNCACHED_MEM_WAR -DMIPS4_ISA -DSP -DIP28 \
  117. -DR10000_SPECULATION_WAR -DR10000 -G 8 -elf -TENV:kernel -TENV:misalignment=1 \
  118. -OPT:space -OPT:quad_align_branch_targets=FALSE \
  119. -OPT:quad_align_with_memops=FALSE -OPT:unroll_times=0 -xansi -fullwarn -64 \
  120. -non_shared $(T5_SPEC_STORES_62)
  121. #endif
  122.  
  123. #endif
  124.